import 'package:flutter/material.dart';
import 'package:flutter_app/components/layout.dart';
class InvalidCouponsPage extends StatefulWidget {
  @override
  _InvalidCouponsPageState createState() => _InvalidCouponsPageState();
}
List<Widget> getCoupons() {
  return [1].map((item) {
    return Container(
      padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 15.0),
      decoration: BoxDecoration(
        image: DecorationImage(
          // alignment: Alignment(0.9, 0.5),
          image: AssetImage('assets/images/bg_coupon_gray.9.png'),
          fit: BoxFit.fill,
        ),
      ),
      child: RowBetween(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          ColumnStart(children: [
            ColumnStart(children: [
              Row(
                children: [
                  Text(
                    '+2%',
                    style: TextStyle(fontSize: 26, fontWeight: FontWeight.bold,color: Colors.grey.withOpacity(0.4)),
                  ),
                  SizedBox(
                      width: 5
                  ),
                  TagContainer('加息',color:Colors.grey.withOpacity(0.4))
                ],
              ),
              Text(
                'Matrixport 限时加息福利',
                style: TextStyle(color: Colors.grey.withOpacity(0.4), fontSize: 12),
              ),

            ]),
            SizedBox(height: 20,),
            Text(
              '使用条件',
              style: TextStyle(fontSize: 13,color: Colors.grey.withOpacity(0.6)),
            ),
          ]),
          Column(
            crossAxisAlignment: CrossAxisAlignment.end,
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Row(
                children: [
                  Icon(Icons.timer,size: 14,color: Colors.grey.withOpacity(0.6),),
                  SizedBox(
                    width: 4,
                  ),
                  Text('2021-03-5',style: TextStyle(fontSize:12,color: Colors.grey.withOpacity(0.6)),),
                ],
              ),
              SizedBox(
                height:10
              ),
              Image.asset('assets/images/ic_coupon_stamp_expired_cn.png',width:60)
            ],
          )
        ],
      ),
    );
  }).toList();
}
class _InvalidCouponsPageState extends State<InvalidCouponsPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: DarkHeadBar('已失效'),
      body:RefreshIndicator(
        onRefresh: () async {},
        child: Container(
          margin: EdgeInsets.symmetric(vertical: 10.0),
          padding: const EdgeInsets.symmetric(horizontal: 20.0),
          child: ListView(
            children: getCoupons(),
          ),
        ),
      )
    );
  }
}
